﻿using BusinessLogic.Interfaces;

namespace BisinessLogic
{
    public static class StatusOrder
    {
       public const int New = 1;
       public const int InProcessing = 2;
       public  const int Executed = 3;
    }

    //Класс, в котором центролизованно происходит обмен данными в приложении
    public class DataManager
    {

        private IUsersRepository _users;
        private PrimaryMembershipProvider _providers;
        private CustomRoleProvider _roleProvider;
        private IRoleRepository _roles;
        private IProducerRepository _producers;
        private ICategoryRepository _categories;
        private IPrepackageRepository _prepackages;
        private IProduceRepository _produces;
        private IProduceInPackageRepository _produceInPackages;
        private ICartRepository _carts;

        private IOrderDetailRepository _orderDetails;
        private IOrderStatusRepository _orderStatuses;
        private IOrderRepository _orders;


        public DataManager(IUsersRepository users
            ,PrimaryMembershipProvider primaryMembershipProvider
            ,CustomRoleProvider roleProvider
            ,IRoleRepository roles
            ,IProducerRepository producers
            ,IProduceInPackageRepository produceInPackages
            ,IProduceRepository produces
            ,ICategoryRepository categories
            ,IPrepackageRepository prepackages
            ,ICartRepository carts
            ,IOrderDetailRepository orderDetails
            ,IOrderStatusRepository orderStatuses
            ,IOrderRepository orders
            )
        {
            _users = users;
            _providers = primaryMembershipProvider;
            _roles = roles;
            _producers = producers;
            _categories = categories;
            _prepackages = prepackages;
            _carts = carts;
            _roleProvider = roleProvider;
            _produces = produces;
            _produceInPackages = produceInPackages;


            _orderDetails = orderDetails;
            _orderStatuses = orderStatuses;
            _orders = orders;


        }

        public IOrderDetailRepository OrderDetails {get { return _orderDetails; }}
        public IOrderStatusRepository OrderStatuses {get { return _orderStatuses; }}
        public IOrderRepository Orders {get { return _orders; }}

        public ICartRepository Carts { get { return _carts; } }
        public IProduceRepository Produces { get { return _produces; } }
        public IProduceInPackageRepository ProduceInPackages  { get { return _produceInPackages; } }
        public IPrepackageRepository Prepackages { get { return _prepackages; } } 
        public ICategoryRepository Categories { get { return _categories; } }
        public IUsersRepository Users { get { return _users; } }
        public IRoleRepository  Roles { get { return _roles; } }
        public IProducerRepository Producers { get { return _producers; } }
        public PrimaryMembershipProvider MembershipProvider { get { return _providers; } } 
        public CustomRoleProvider RoleProvider {get { return _roleProvider; }}
    }
}
